package com.tianql.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tianql.mapper.StorageTblMapper;
import com.tianql.pojo.StorageTbl;
import org.apache.seata.core.context.RootContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author 田起立
 * @Date 2024/6/11 15:17
 * @Description:
 */
@Service
public class StorageServiceImpl extends ServiceImpl<StorageTblMapper, StorageTbl> {
    @Autowired
    private StorageTblMapper storageTblMapper;

    public String deduct(String commodityCode, int count) {
        String xid = RootContext.getXID();
        storageTblMapper.deduct(commodityCode, count);
        return "减库存成功";
    }
}
